package com.gxa.saas.service.impl;

import com.gxa.saas.mapper.OrderMapper;
import com.gxa.saas.pojo.Order;

import com.gxa.saas.pojo.OrderAdd;
import com.gxa.saas.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.xml.crypto.Data;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Service

public class OrderServiceImpl implements OrderService {

    @Autowired
    OrderMapper orderMapper;
    @Override
    public List<Order> selectByPage(Integer page, Integer size) {
        return orderMapper.selectByPage((page-1)*size,size);
    }

    @Override
    public Integer delete(Integer id) {
        return orderMapper.delete(id);
    }

    @Override
    public Integer insert(Order order) {
        return orderMapper.insert(order);
    }

    @Override
    public Integer update(Order order) {
        return orderMapper.update(order);
    }

    @Override
    public List<Order> selectAll() {
        return orderMapper.selectAll();
    }

    @Override
    public Order selectByDate(Date date) {
        return orderMapper.selectByDate(date);
    }


    @Override
    public List<OrderAdd> selectList() {
        return orderMapper.selectList();
    }


    @Override
    public List<Order> selectByDesc(Integer page, Integer size) {
        return orderMapper.selectByDesc((page-1)*size,size);
    }

    @Override
    public List<Order> selectByAsc(Integer page, Integer size) {
        return orderMapper.selectByAsc((page-1)*size,size);
    }

    @Override
    public Order selectByOrderId(Integer id) {
        return orderMapper.selectByOrderId(id);
    }

    @Override
    public List<Order> selectByName(Map map) {
        return orderMapper.selectByName(map);
    }


}
